package cn.e3.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.e3.easyuitreenode.EasyuiTreeNode;
import cn.e3.service.ItemCatService;

@Controller
public class ItemCatController {
	@Autowired
	private ItemCatService itemCatService;
	@RequestMapping(value="/item/cat/list")
	@ResponseBody
	//刚开始为兵没有id传入，设置默认值为0
	public List<EasyuiTreeNode> getItemCatList(@RequestParam(name="id",defaultValue="0")long parentId){
		List<EasyuiTreeNode> list = itemCatService.getItemCatList(parentId);
		return list;
	}
}
